package com.js.blog.consts;

/**
 * @author yanglin
 * @create 2024-03-01 15:50 星期五
 * description:
 */
public enum PublishPermissionEnum {
    PUBLISH_ARTICLE("PUBLISH_ARTICLE","发布文章");
    
    private String code;
    
    private String message;
    
    PublishPermissionEnum(String code,String message){
        this.code = code;
        this.message = message;
    }
    
    public String getCode(){
        return this.code;
    }
    
    public String getMessage(){
        return this.message;
    }


    /**
     * 根据枚举的code获取枚举的message
     */
    public static String getMessageByCode(String code){
        for (PublishPermissionEnum value : PublishPermissionEnum.values()) {
            if (value.getCode() == code){
                return value.getMessage();
            }
        }
        return null;
    }
}
